# -*- coding: utf-8 -*-
from typing import Optional, List,Any
from pydantic import BaseModel, Field, EmailStr
from datetime import datetime,timedelta,timezone


# class Job(MappedBase):
#     __tablename__ = 'job'
#     id:Mapped[int]=mapped_column(primary_key=True, index=True, autoincrement=True, comment='主键id')
#     job_id: Mapped[str] = mapped_column(String(20), unique=True, nullable=False, comment='存在job数据中的job_id')
#     desp: Mapped[str] = mapped_column(String(50), unique=True,  nullable=False,comment='job的文字说明')
#     func: Mapped[str] = mapped_column(String(51), unique=False,  nullable=False,comment='job定时执行的函数名称')




class ReqCreateJob(BaseModel):

    desp:str = Field(...)
    func:str = Field(...)
    cron:str = Field(...)


    

    class Config:
        schema_extra = {
            "example": {
                "desp": '定时巡检恒温恒湿机台', 
                "func": 'run_const_temp_humi',
                "cron": 'cron表达式,比如* * * * *',
            }
        }

    


    




